
package interfaz;



import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.Border;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;



public class PnlFondoJDialog extends javax.swing.JPanel {
	
	private int mon=0;
	private int rub=0;
	private int ani=0;
	private int dia=0;
	private int col=0;
	

	public PnlFondoJDialog(int moneda, int rubi, int anillo, int diamante, int colgante) {
	      
		super();
		setSize(450, 450);
		
		if (moneda!=0){
			mon=moneda;
		}
		if (rubi!=0){
			rub=rubi;
		}
		if (anillo!=0){
			ani=anillo;
		}
		if (diamante!=0){
			dia=moneda;
		}
		if (colgante!=0){
			col=moneda;
		}
			
		 

	      JLabel label = new JLabel("El arque\u00F3logo recorri\u00F3 la isla Em\u00EDrece");
	      label.setFont(new Font("Calibri", Font.BOLD, 22));
	      label.setForeground(Color.black);
	     
	    
	      
	      JLabel label_1 = new JLabel("con \u00E9xito!");
	      label_1.setFont(new Font("Calibri", Font.BOLD, 22));
	      label_1.setForeground(Color.black);
	      
	      JLabel label_4 = new JLabel("Monedas de oro: " + mon);
	      label_4.setFont(new Font("Calibri", Font.BOLD, 18));
	      label_4.setIcon(new ImageIcon(Exito.class.getResource("/imagenes/moneda.png")));
	      label_4.setForeground(Color.black);
	      
	      JLabel label_5 = new JLabel("Rub\u00EDes: " + rub);
	      label_5.setFont(new Font("Calibri", Font.BOLD, 18));
	      label_5.setIcon(new ImageIcon(Exito.class.getResource("/imagenes/rubi.png")));
	      label_5.setForeground(Color.black);
	      
	      JLabel label_6 = new JLabel("Anillos: " + ani);
	      label_6.setFont(new Font("Calibri", Font.BOLD, 18));
	      label_6.setIcon(new ImageIcon(Exito.class.getResource("/imagenes/anillo.png")));
	      label_6.setForeground(Color.black);
	      
	      JLabel label_7 = new JLabel("Diamantes: " + dia);
	      label_7.setFont(new Font("Calibri", Font.BOLD, 18));
	      label_7.setIcon(new ImageIcon(Exito.class.getResource("/imagenes/diamante.png")));
	      label_7.setForeground(Color.black);
	      
	      JLabel label_8 = new JLabel("Colgantes: " + col);
	      label_8.setFont(new Font("Calibri", Font.BOLD, 18));
	      label_8.setIcon(new ImageIcon(Exito.class.getResource("/imagenes/collar.png")));
	      label_8.setForeground(Color.black);
	      
	      JButton button = new JButton("Aceptar");
	      button.addActionListener(new ActionListener() {
	      	public void actionPerformed(ActionEvent arg0) {
	      		System.exit(0);
	      	}
	      });
	      button.setFont(new Font("Calibri", Font.PLAIN, 18));
	      
	      JLabel lblNewLabel = new JLabel("");
	      lblNewLabel.setIcon(new ImageIcon(PnlFondoJDialog.class.getResource("/imagenes/arqueologo72.png")));
	      
	      JLabel label_2 = new JLabel("");
	      label_2.setIcon(new ImageIcon(PnlFondoJDialog.class.getResource("/imagenes/tesoro72.png")));
	      
	      JLabel label_3 = new JLabel("");
	      label_3.setIcon(new ImageIcon(PnlFondoJDialog.class.getResource("/imagenes/pirata72.png")));
	      
	      GroupLayout groupLayout = new GroupLayout(this);
	      groupLayout.setHorizontalGroup(
	      	groupLayout.createParallelGroup(Alignment.LEADING)
	      		.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
	      			.addContainerGap(108, Short.MAX_VALUE)
	      			.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
	      				.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
	      					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
	      						.addComponent(label_8, GroupLayout.PREFERRED_SIZE, 207, GroupLayout.PREFERRED_SIZE)
	      						.addComponent(label_7, GroupLayout.PREFERRED_SIZE, 212, GroupLayout.PREFERRED_SIZE)
	      						.addComponent(label_6, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	      						.addComponent(label_4, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
	      						.addComponent(label_5, Alignment.LEADING))
	      					.addGroup(groupLayout.createSequentialGroup()
	      						.addComponent(lblNewLabel)
	      						.addPreferredGap(ComponentPlacement.UNRELATED)
	      						.addComponent(label_2)
	      						.addGap(18)
	      						.addComponent(label_3)))
	      				.addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup()
	      					.addPreferredGap(ComponentPlacement.RELATED, 75, GroupLayout.PREFERRED_SIZE)
	      					.addComponent(button, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE)
	      					.addGap(68)))
	      			.addGap(98))
	      		.addGroup(groupLayout.createSequentialGroup()
	      			.addGap(48)
	      			.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
	      				.addGroup(groupLayout.createSequentialGroup()
	      					.addGap(127)
	      					.addComponent(label_1, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE))
	      				.addComponent(label, GroupLayout.PREFERRED_SIZE, 354, GroupLayout.PREFERRED_SIZE))
	      			.addContainerGap(48, Short.MAX_VALUE))
	      );
	      groupLayout.setVerticalGroup(
	      	groupLayout.createParallelGroup(Alignment.LEADING)
	      		.addGroup(groupLayout.createSequentialGroup()
	      			.addGap(29)
	      			.addComponent(label, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
	      			.addPreferredGap(ComponentPlacement.RELATED)
	      			.addComponent(label_1, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
	      			.addGap(11)
	      			.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
	      				.addComponent(lblNewLabel)
	      				.addComponent(label_2)
	      				.addComponent(label_3))
	      			.addGap(18)
	      			.addComponent(label_5, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
	      			.addGap(18)
	      			.addComponent(label_4, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
	      			.addGap(18)
	      			.addComponent(label_6, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
	      			.addGap(18)
	      			.addComponent(label_7, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
	      			.addGap(18)
	      			.addComponent(label_8, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)
	      			.addGap(18)
	      			.addComponent(button, GroupLayout.PREFERRED_SIZE, 33, GroupLayout.PREFERRED_SIZE)
	      			.addContainerGap(19, Short.MAX_VALUE))
	      );
	      setLayout(groupLayout);
	   }
	
	public void paintComponent(Graphics g){
	   
		 
	      ImageIcon imagenFondo = new ImageIcon(getClass().
	      getResource("/imagenes/mapa5.jpg"));
	      g.drawImage(imagenFondo.getImage(), 0, 0,450,450, null);
	      setOpaque(false);
	      super.paintComponent(g);	      
	      
	   }
}

